package com.newenergy.wisehome.common.helper;

/**
 * Created by dell on 2017/3/30.
 */

public class LightHelper {

    private static String  LAST_GROUPS_ID = "LAST_GROUPS_ID";
    private static String  LAST_LINGHT_SERIAL ="LAST_LINGHT_SERIAL";;

    public static int getGroupId() {
        int gid = SPUtil.getInteger(LAST_GROUPS_ID, 1);
        int groupId=gid;
        gid++;
        gid = gid > 255 ? 1 : gid;

        SPUtil.put(LAST_GROUPS_ID, gid);
        return groupId;
    }



    public static void resetLightSerial(int serial) {
        serial = 0;
        SPUtil.put(LAST_LINGHT_SERIAL, serial);
    }
    public static void getLightSerial() {
        int serial = SPUtil.getInteger(LAST_LINGHT_SERIAL,1);
        SPUtil.put(LAST_LINGHT_SERIAL, serial);
    }

}
